from data_loader import *
from network import *
import time
import matplotlib.pyplot as plt

start = time.time()
training_data, validation_data, test_data = load_data_wrapper()
training_data = list(training_data)
validation_data = list(validation_data)
test_data = list(test_data)

# 当隐藏层k=3时
# accuracy_list=[]
# for m in range(10,124):
net = Network([784,30, 10])
net.SGD(training_data, 30, 10, 1.3, validation_data,test_data=test_data)
    # accuracy_list.append(accuracy)

# x = range(10, 124)
# max_acc=max(accuracy_list)
# max_index = accuracy_list.index(max_acc)
# print(f"当神经元m={10+max_index} 时，验证精度最大值为：{max_acc}")
# plt.plot(x, accuracy_list)
# plt.xlabel('m')
# plt.ylabel('val_accuracy')
# plt.show()

end = time.time()
print("运行所用时间： ", end - start)





